package com.audaque.springboot.foshanupload.web.nettydemo.handler;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;


public class EchoInboundHandler1 extends ChannelInboundHandlerAdapter {
    //读空闲事件计数
    public static Integer readIdleTimes = 0;

    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
        System.out.println("进入 EchoInboundHandler1.channelRead");
        EchoInboundHandlerUtils.channelRead(ctx, msg);
        System.out.println("退出 EchoInboundHandler1 channelRead");
    }

    @Override
    public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
        System.out.println("[EchoInboundHandler1.channelReadComplete]");
    }

    @Override
    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
        System.out.println("[EchoInboundHandler1.exceptionCaught]" + cause.toString());
    }

    @Override
    public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
        EchoInboundHandlerUtils.userEventTriggeredClose(ctx, evt);
    }


}
